#include <bits/stdc++.h>
using namespace std;
const int N=10000000;
//...................................
#define FAST    ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define ll      long long int
#define ss      second
#define ff      first
#define pb      push_back
#define pll     pair<ll,ll>
#define F(i,n)  for(ll i=0;i<n;i++)
#define vll     vector <ll>
#define t_case  ll test;cin>>test;while(test--)
#define all(a)  a.begin(),a.end()
//...................................
bool cmp(ll x,ll y) {return x>y;}
ll min3(ll x,ll y,ll z) {return min(x,min(y,z));}
ll max3(ll x,ll y,ll z) {return max(x,max(y,z));}
ll powrec(ll a,ll n){if(n==0) return 1;ll res=powrec(a,n/2);if(n%2)return res*res*a;else return res*res;}
ll powloop(ll a,ll n){ll res=1;while(n>0){if(n&1)res=res*a;a=a*a;n>>=1;}return res;}
ll powmod(ll a,ll n,ll m){a%=m;ll res=1;while(n>0){if(n&1)res=res*a%m;a=a*a%m;n>>=1;}return res;}
//...................................
int main()
{


    t_case
    {
        ll n,x,p,k;
    cin>>n>>x>>p>>k;
    ll a[n];
    F(i,n)
    {
        cin>>a[i];
    }
    sort(a,a+n);
    ll c=0,flag=0;
    F(i,300)
    {
        if(a[p-1]==x)
        {
            flag=1; break;
        }
        c++;
        a[k-1]=x;
        sort(a,a+n);
    }
    if(flag==1) cout<<c<<endl;
    else cout<<-1<<endl;
    }
    return 0;
}
